<template>
  <div class="tws-login-top">
    <div class="tws-n-left">{{$store.state.app.settingList.site_name}}</div>
    <ul class="tws-n-right">
      <li v-for="(item,index) in navList" :key="index">
        <router-link :to="item.url" target="_blank" v-if="item.new_open">{{item.name}}</router-link>
        <router-link :to="item.url" v-else>{{item.name}}</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'top',
  data() {
    return {
      navList: {}
    }
  },
  created() {
    //获取导航
    this.$api.fetchListNavIdent({ident: 20}).then(response => {
      if(response.info.nav_list.length){
        this.navList = response.info.nav_list
      }
    })
  },
}
</script>
